/*
 * SystemPushProcess.java
 * business
 *
 * Created by ChenTao on 2017/6/30.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.push.process;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

import com.yidiandao.business.constant.Intents;
import com.yidiandao.business.data.bean.Message;
import com.yidiandao.business.data.push.AbsPushProcess;
import com.yidiandao.business.ui.url.UrlActivity;

/**
 * 系统推送
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017-06-30 10:10
 */
public class SystemPushProcess extends AbsPushProcess {

    public SystemPushProcess(Context context, Message message, boolean isForeground) {
        super(context, message, isForeground);
    }

    @Override
    public Intent getClickNotificationJumpActivityIntent() {
        return new Intent(mContext, UrlActivity.class);
    }

    @Override
    public void onDialogEnsureButtonClick(Message message) {
        if (!TextUtils.isEmpty(message.getUrl())) {
            UrlActivity.actionStart((Activity) mContext, message.getUrl());
        }
    }

    @Override
    protected void addExtraDataToNotificationClickReceiverIntent(Intent intent) {
        intent.putExtra(Intents.TITLE, mMessage.getTitle());
        intent.putExtra(Intents.HTTP_URL, mMessage.getUrl());
    }
}
